<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{$CONF['shopTitle']['fieldValue']}后台管理中心</title>
    <link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="__CSS__/AdminLTE.css" rel="stylesheet" type="text/css" />
    <link href="__CSS__/upload.css" rel="stylesheet" type="text/css" />

    <!--[if lt IE 9]>
    <script src="__PUBLIC__/js/html5shiv.min.js"></script>
    <script src="__PUBLIC__/js/respond.min.js"></script>
    <![endif]-->
    <script src="__PUBLIC__/js/jquery.min.js"></script>
    <script src="__PUBLIC__/js/base64.js"></script>
    <script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
    <script src="__PUBLIC__/js/common.js"></script>
    <script src="__PUBLIC__/plugins/plugins/plugins.js"></script>
    <script src="__PUBLIC__/plugins/formValidator/formValidator-4.1.3.js"></script>
    <script src="__PUBLIC__/plugins/kindeditor/kindeditor.js"></script>
    <script src="__PUBLIC__/plugins/kindeditor/lang/zh_CN.js"></script>
    <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=2b53397482f52f92dcb7c528d99d9fca"></script>
    <script type="text/javascript" src="__JS__/upload.js"></script>

</head>
<style>
    img {width:auto;}
    .ATRoot{height:22px;line-height:22px;margin-left:5px;clear:both;cursor:pointer;}
    .ATNode{margin-left:5px;line-height:22px;margin-left:17px;clear:both;cursor:pointer;}
    .Hide{display:none;}
    dl.areaSelect{padding:0 5px; display: inline-block; width:100%; margin-bottom: 0;/*border:1px solid #eee;*/}
    dl.areaSelect:hover{border:1px solid #E5CD29;}
    dl.areaSelect:hover dd{display: block;}
    dl.areaSelect dd{ float: left; margin-left: 20px; cursor: pointer;}
</style>
<script>
    var shopMap = null;
    var toolBar = null;
    var filetypes = ["gif","jpg","png","jpeg"];
    var ThinkPHP = window.Think = {
        "ROOT"   : "__ROOT__"
    }
    $(function () {
        $("#openService").on('click',function(){
                   $.ajax({
                               url:'http://kf.***.com/wbadmin/duoshanghuadd.php',
                               data:{
                                   key:'ZHVvc2hhbmdodXNob3A=',
                                   title:$("#shopName").val(),
                                   comperson:$("#userName").val(),
                                   comtel:$("#userPhone").val(),
                                   operator:$("#userPhone").val(),
                               },
                               type:"get",
                                dataType:'json',
                               success:function( res ){
//                                   console.log(res);
                                   var data ={};
                                   if(res.status=='true'){
                                       $("#ServiceMessage").html('注册客服账号成功请及时保存数据');
//                                       data.loginurl =   base64decode(res.data.loginurl);
//                                       data.webappurl =   res.data.webappurl;
//                                       console.log(data.loginurl);
//                                       console.log(data.webappurl);
                                       var datas = JSON.stringify(res.data);
                                       console.log(datas);
                                       $("#Service").attr('value',datas);
                                   }else{
                                       $("#ServiceMessage").html(res.data);
                                   }

                               }


                           });
            return false;
        });



        //展开按钮
        $("#expendAll").click(function(){
            if ($(this).prop('checked')==true) {$("dl.areaSelect dd").removeClass('Hide')}
            else{$("dl.areaSelect dd").addClass('Hide')}
        })
        $.formValidator.initConfig({
            theme:'Default',mode:'AutoTip',formID:"myform",debug:true,submitOnce:true,onSuccess:function(){
                edit();
                return false;
            },onError:function(msg){
            }});
        $("#loginName").formValidator({onShow:"",onFocus:"会员账号应该为5-16字母、数字或下划线",onCorrect:"输入正确"}).inputValidator({min:5,max:16,onError:"会员账号应该为5-16字母、数字或下划线"}).regexValidator({
            regExp:"username",dataType:"enum",onError:"会员账号格式错误"
        }).ajaxValidator({
            dataType : "json",
            async : true,
            url : "{:U('Admin/Users/checkLoginKey')}",
            success : function(data){
                var json = WST.toJson(data);
                if( json.status == "1" ) {
                    return true;
                } else {
                    return false;
                }
                return "该账号已被使用";
            },
            buttons: $("#dosubmit"),
            onError : "该账号已存在。",
            onWait : "请稍候..."
        }).defaultPassed();
       /* $("#loginPwd").formValidator({
            onShow:"",onFocus:"登录密码长度应该为5-20位之间"
        }).inputValidator({
            min:5,max:50,onError:"登录密码长度应该为5-20位之间"
        });*/

        $("#userPhone").inputValidator({min:11,max:11,onError:"你输入的手机号码非法,请确认"}).ajaxValidator({
            dataType : "json",
            async : true,
            url : "{:U('Admin/Users/checkLoginKey',array('id'=>$object['userId']))}",
            success : function(data){
                var json = WST.toJson(data);
                if( json.status == "1" ) {
                    return true;
                } else {
                    return false;
                }
                return "该手机号码已被使用";
            },
            buttons: $("#dosubmit"),
            onError : "该手机号码已存在。",
            onWait : "请稍候..."
        }).defaultPassed().unFormValidator(true);
        $("#shopSn").formValidator({onShow:"",onFocus:"店铺编号不能超过20个字符",onCorrect:"输入正确"}).inputValidator({min:1,max:20,onError:"店铺编号不符合要求,请确认"});
        $("#shopName").formValidator({onShow:"",onFocus:"店铺名称不能超过20个字符",onCorrect:"输入正确"}).inputValidator({min:1,max:20,onError:"店铺名称不符合要求,请确认"});
        $("#userName").formValidator({onShow:"",onFocus:"请输入店主姓名",onCorrect:"输入正确"}).inputValidator({min:1,max:20,onError:"店主姓名不能为空,请确认"});
        $("#shopCompany").formValidator({onShow:"",onFocus:"请输入公司名称",onCorrect:"输入正确"}).inputValidator({min:1,max:50,onError:"公司名称不能为空,请确认"});
        $("#shopTel").formValidator({onShow:"",onFocus:"请输入店铺电话",onCorrect:"输入正确"}).inputValidator({min:1,max:50,onError:"店铺电话不能为空,请确认"});
        $("#shopAddress").formValidator({onShow:"",onFocus:"请输入店铺地址",onCorrect:"输入正确"}).inputValidator({min:1,max:120,onError:"店铺地址不能为空,请确认"});
        $("#areaId3").formValidator({onFocus:"请选择所属地区"}).inputValidator({min:1,onError: "请选择所属地区"});
        $("#goodsCatId2").formValidator({onFocus:"请选择完整所属行业"}).inputValidator({min:1,onError: "请选择所属行业"});
        $("#idNo").formValidator({onShow:"",onFocus:"请输入身份证号",onCorrect:"输入正确"}).inputValidator({min:18,max:18,onError:"身份证错误,请确认"});
        //$("#permitNo").formValidator({onShow:"",onFocus:"请输入营业执照编号",onCorrect:"输入正确"}).inputValidator({min:16,max:19,onError:"营业执照错误,请确认"});
        $("#serviceStartTime").formValidator({onShow:"",onFocus:"请选择营业时间"}).inputValidator({min:1,max:50,onError:"请选择营业时间"});
        $("#serviceEndTime").formValidator({onShow:"",onFocus:"请选择营业时间"}).inputValidator({min:1,max:50,onError:"请选择营业时间"});
        //$("#bankNo").formValidator({onShow:"",onFocus:"请输入银行卡号",onCorrect:"输入正确"}).inputValidator({min:16,max:19,onError:"银行卡号格式错误,请确认"});

        $("#userPhone").blur(function(){
            if($("#userPhone").val()==''){
                $("#userPhone").unFormValidator(true);
            }else{
                $("#userPhone").unFormValidator(false);
            }
        });
        ShopMapInit();
        <if condition="$object['shopId'] !=0 ">
            getAreaList("areaId2",{$object.areaId1},0,{$object.areaId2});
            getAreaList("areaId3",{$object.areaId2},1,{$object.areaId3});
            getCatList("goodsCatId2",{$object.goodsCatId1},0,{$object.goodsCatId2});
        </if>

    initTime('serviceStartTime','{$object['serviceStartTime']}');
    initTime('serviceEndTime','{$object['serviceEndTime']}');
    getCommunitys();

    if ($("input[name='shopStatus']:checked").val() <= -1) {
        yj_unformValidator();
    };

    //拒绝申请要求填写拒绝理由
    $("input[name='shopStatus']").change(function(){
        if ($(this).val()<=-1) { //选择拒绝的时候
            $('#refuseMsg').show();
            yj_unformValidator();
        }else{ //恢复验证
            $('#refuseMsg').hide();
            reformValidator();
        }
    });
    });
    //取消校验
    function yj_unformValidator(){
        $("#loginName").attr("disabled",true).unFormValidator(true); //解除校验
        //$("#loginPwd").attr("disabled",true).unFormValidator(true); //解除校验
        $("#userPhone").attr("disabled",true).unFormValidator(true); //解除校验
        $("#shopSn").attr("disabled",true).unFormValidator(true); //解除校验
        $("#shopName").attr("disabled",true).unFormValidator(true); //解除校验
        $("#userName").attr("disabled",true).unFormValidator(true); //解除校验
        $("#shopCompany").attr("disabled",true).unFormValidator(true); //解除校验
        $("#shopAddress").attr("disabled",true).unFormValidator(true); //解除校验
        $("#areaId3").attr("disabled",true).unFormValidator(true); //解除校验
        $("#goodsCatId3").attr("disabled",true).unFormValidator(true); //解除校验
        $("#bankId").attr("disabled",true).unFormValidator(true); //解除校验

        $("#serviceStartTime").attr("disabled",true).unFormValidator(true); //解除校验
        $("#serviceEndTime").attr("disabled",true).unFormValidator(true); //解除校验
    }
    //恢复校验
    function reformValidator(){
        $("#loginName").attr("disabled",false).unFormValidator(false); //解除校验
        //$("#loginPwd").attr("disabled",false).unFormValidator(false); //解除校验
        $("#userPhone").attr("disabled",false).unFormValidator(false); //解除校验
        $("#shopSn").attr("disabled",false).unFormValidator(false); //解除校验
        $("#shopName").attr("disabled",false).unFormValidator(false); //解除校验
        $("#userName").attr("disabled",false).unFormValidator(false); //解除校验
        $("#shopCompany").attr("disabled",false).unFormValidator(false); //解除校验
        $("#shopAddress").attr("disabled",false).unFormValidator(false); //解除校验
        $("#areaId3").attr("disabled",false).unFormValidator(false); //解除校验
        $("#goodsCatId3").attr("disabled",false).unFormValidator(false); //解除校验
        $("#bankId").attr("disabled",false).unFormValidator(false); //解除校验

        $("#serviceStartTime").attr("disabled",false).unFormValidator(false); //解除校验
        $("#serviceEndTime").attr("disabled",false).unFormValidator(false); //解除校验
    }
    function ShopMapInit(option){
        var opts = {zoom:$('#mapLevel').val(),longitude:$('#longitude').val(),latitude:$('#latitude').val()};
        if(shopMap)return;
        $('#shopMap').show();
        shopMap = new AMap.Map('mapContainer', {
            view: new AMap.View2D({
                zoom:opts.zoom
            })
        });
        if(opts.longitude!='' && opts.latitude!=''){
            shopMap.setZoomAndCenter(opts.zoom, new AMap.LngLat(opts.longitude, opts.latitude));
            var marker = new AMap.Marker({
                position: new AMap.LngLat(opts.longitude, opts.latitude), //基点位置
                icon:"http://webapi.amap.com/images/marker_sprite.png"
            });
            marker.setMap(shopMap);
        }
        shopMap.plugin(["AMap.ToolBar"],function(){
            toolBar = new AMap.ToolBar();
            shopMap.addControl(toolBar);
            toolBar.show();
        });

        AMap.event.addListener(shopMap,'click',function(e){
            shopMap.clearMap();
            $('#longitude').val(e.lnglat.getLng());
            $('#latitude').val(e.lnglat.getLat());
            var marker = new AMap.Marker({
                position: e.lnglat, //基点位置
                icon:"http://webapi.amap.com/images/marker_sprite.png"
            });
            marker.setMap(shopMap);
        });
        AMap.event.addListener(shopMap,'zoomchange',function(e){
            $('#mapLevel').val(this.getZoom());
        })
    }
    function getAreaList(objId,parentId,t,id){
        var params = {};
        params.parentId = parentId;
        $('#'+objId).empty();
        if(t<1){
            $('#areaId3').empty();
            $('#areaId3').html('<option value="">请选择</option>');
        }else{
            if(t==1 && $('#areaId2').find("option:selected").text()!=''){
                shopMap.setZoom();
                shopMap.setCity($('#areaId2').find("option:selected").text());
                $('#showLevel').val(shopMap.getZoom());
            }
        }
        var html = [];
        $.post("{:U('Admin/Areas/queryShowByList')}",params,function(data,textStatus){
            html.push('<option value="">请选择</option>');
            var json = WST.toJson(data);
            if(json.status=='1' && json.list && json.list.length>0){
                var opts = null;
                for(var i=0;i<json.list.length;i++){
                    opts = json.list[i];
                    html.push('<option value="'+opts.areaId+'" '+((id==opts.areaId)?'selected':'')+'>'+opts.areaName+'</option>');
                }
            }
            $('#'+objId).html(html.join(''));
            if(id)getCommunitys();
        });
    }

    var relateCommunity = "{$object['relateCommunity']}".split(',');
    var relateArea = "{$object['relateArea']}".split(',');

    //修改部分 2015-4-23 lijingwei
    function getCommunitys(){
        $('#areaTree').empty();
        var v = $('#areaId2').val();
        if(v!==-1){
            $.post("{:U('Admin/Areas/queryAreaAndCommunitysByList')}",{areaId:v},function(data,textStatus){
                var json = data;
                if(json.list){
                    var html = [];
                    json = json.list;
                    for(var i=0;i<json.length;i++){
                        var isAreaSelected = ($.inArray(json[i]['areaId'],relateArea)>-1)?" checked ":"";
                        communitysCount = 0
                        if (json[i].communitys) {
                            for (var j =json[i].communitys.length - 1; j >= 0; j--) {
                                if ($.inArray(json[i].communitys[j]['communityId'],relateCommunity) > -1 ) {communitysCount++;};
                            };
                        };
                        html.push("<dl class='areaSelect' id='"+json[i]['areaId']+"'>");
                        html.push("<dt class='ATRoot' id='node_"+json[i]['areaId']+"' isshow='0'>"+json[i]['areaName']+"：<span> <input type='checkbox' all='1' class='AreaNode' onclick='javascript:selectArea(this)' id='ck_"+json[i]['areaId']+"' "+isAreaSelected+" value='"+json[i]['areaId']+"'><label for='ck_"+json[i]['areaId']+"' "+isAreaSelected+" value='"+json[i]['areaId']+"'>全区配送</label></span> <small>(已选<span class='count'>"+communitysCount+"</span>个社区)</small></dt>");
                        if(json[i].communitys && json[i].communitys.length){
                            for(var j=0;j<json[i].communitys.length;j++){
                                var isCommunitySelected = ($.inArray(json[i].communitys[j]['communityId'],relateCommunity)>-1)?" checked ":"";
                                isCommunitySelected += (isAreaSelected!='')?" disabled ":"";
                                html.push("<dd id='node_"+json[i]['areaId']+"_"+json[i].communitys[j]['communityId']+"'><input type='checkbox' id='ck_"+json[i]['areaId']+"_"+json[i].communitys[j]['communityId']+"' all='0' class='AreaNode' "+isCommunitySelected+" onclick='javascript:selectArea(this)' value='"+json[i].communitys[j]['communityId']+"'><label for='ck_"+json[i]['areaId']+"_"+json[i].communitys[j]['communityId']+"'>"+json[i].communitys[j]['communityName']+"</label></dd>");
                            }
                        }
                        html.push("</dl>");
                    }
                    $('#areaTree').html(html.join(''));
                    $('#expendAll').parent().removeClass('Hide');
                    $('#expendAll').attr('checked','checked');
                }
            });
        }
    }
    function selectArea(v){
        count = 0;
        if($(v).attr('all')=='1'){
            $('input[id^="'+$(v).attr('id')+'_"]').each(function(){
                $(this)[0].checked = $(v)[0].checked;
                $(this)[0].disabled = $(v)[0].checked;
                if ($(v)[0].checked) {count++};
            });
        }else{
            $(v).closest('dl').find('input[type="checkbox"]').each(function(){
                if ($(this).prop('checked') == true) { count++};
            });
        }
        $(v).closest('dl').find('.count:first').html(count);
    }
    //修改结束 2015-4-23
    function edit(){
		  //配送方式
 	   var psMode='';
 	   $('.psMode').each(function(){
	 		   if($(this).is(':checked')){
	 			   psMode+=$(this).val()+',';
	 		   }
	 	   })

        psMode=psMode.substring(0,psMode.length-1);
        var params = {};
		params.psMode = psMode;
        params.id = $('#id').val();
        <if condition="$object['shopId'] ==0 ">
	    params.loginName = $('#loginName').val();
	    </if>
        //银行卡选填
        if($('#bankNo').val().length>0){
            if($('#bankNo').val().length<16 || $('#bankNo').val().length>25){
                Plugins.Tips({title:'信息提示',icon:'error',content:'银行卡格式错误!',timeout:1000});
                return;
            }else{
                params.bankNo = $('#bankNo').val();
            }
        }


        params.loginPwd = $('#loginPwd').val();
        params.userName = $('#userName').val();
        params.userPhone = $('#userPhone').val();
        params.shopSn = $('#shopSn').val();
        params.areaId1 = $('#areaId1').val();
        params.areaId2 = $('#areaId2').val();
        params.areaId3 = $('#areaId3').val();//地区
        params.goodsCatId1 = $('#goodsCatId1').val();
        params.goodsCatId2 = $('#goodsCatId2').val();
        //params.isSelf = $("input[name='isSelf']:checked").val();
        params.shopName = $('#shopName').val();
        params.shopCompany = $('#shopCompany').val();
        params.shopStatus = $("input[name='shopStatus']:checked").val();
		params.goodsAudit = $("input[name='goodsAudit']:checked").val();
        params.shopImg = $('#shopImg').val();
        params.permitImg = $('#permitImg').val();
        params.identityImg = $('#identityImg').val();
        params.identityRevImg = $('#identityRevImg').val();
        params.latitude = $('#latitude').val();
        params.longitude = $('#longitude').val();
        params.mapLevel = $('#mapLevel').val();
        params.proportion = $('#proportion').val();
        //params.Service = $('#Service').val();
        //拒绝的时候不用上传

        /*if((params.shopImg=='' || params.permitImg=='' || params.identityImg=='' ||  params.identityRevImg=='')  && params.shopStatus!=-1 ){
            Plugins.Tips({title:'信息提示',icon:'error',content:'请上传店铺图片!',timeout:1000});
            return;
        }*/
        params.permitNo = $('#permitNo').val();
        params.idNo = $('#idNo').val();
        params.shopTel = $('#shopTel').val();
        //params.userEmail = $('#userEmail').val();
        params.qqNo = $('#qqNo').val();
        params.shopAddress = $('#shopAddress').val();
        params.deliveryFreeMoney = $('#deliveryFreeMoney').val();
        params.deliveryMoney = $('#deliveryMoney').val();
        params.avgeCostMoney = $('#avgeCostMoney').val();
        params.deliveryCostTime = $('#deliveryCostTime').val();
        params.deliveryStartMoney = $('#deliveryStartMoney').val();
        params.bankId = $('#bankId').val();

        params.isInvoice = $("input[name='isInvoice']:checked").val();
        //params.invoiceRemarks = $('#invoiceRemarks').val();
        params.serviceStartTime = $('#serviceStartTime').val();
        params.serviceEndTime = $('#serviceEndTime').val();
        params.statusRemarks = $('#statusRemarks').val();

        if(params.shopStatus==1){
            if(params.latitude=='' || params.longitude==''){
                Plugins.Tips({title:'信息提示',icon:'error',content:'请在地图上标注店铺所在位置!',timeout:1000});
                return;
            }
        }
        if(params.identityImg==''){
            Plugins.Tips({title:'信息提示',icon:'error',content:'身份证正面图片!',timeout:1000});
            return;
        }
        if(params.identityRevImg==''){
            Plugins.Tips({title:'信息提示',icon:'error',content:'身份证反面图片!',timeout:1000});
            return;
        }
        params.shopAtive = $("input[name='shopAtive']:checked").val();
        var relateArea = [0];
        var relateCommunity = [0];
        $('.AreaNode').each(function(){
            if($(this)[0].checked){
                if($(this).attr('all')==1){
                    relateArea.push($(this).val());
                }else{
                    relateCommunity.push($(this).val());
                }
            }
        });
        params.relateAreaId=relateArea.join(',');
        params.relateCommunityId=relateCommunity.join(',');
        // if(params.relateAreaId=='0' && params.relateCommunityId=='0' && params.shopStatus!=-1){
        //     Plugins.Tips({title:'信息提示',icon:'error',content:'请选择配送区域!',timeout:1000});
        //     return;
        // }
        //拒绝的时候要求写备注
        if(params.shopStatus<=-1 && params.statusRemarks == ''){
            Plugins.Tips({title:'信息提示',icon:'error',content:'请填写拒绝理由!',timeout:1000});
            return;
        }
        Plugins.waitTips({title:'信息提示',content:'正在提交数据，请稍后...'});
        $.post("{:U('Admin/Shops/edit')}",params,function(data,textStatus){
            var json = WST.toJson(data);
            if(json.status=='1'){
                Plugins.setWaitTipsMsg({ content:'操作成功',timeout:1000,callback:function(){
                    location.href='{:U("Admin/Shops/$src")}';
                }});
            }else if(json.status=='-2'){
                Plugins.closeWindow();
                Plugins.Tips({title:'信息提示',icon:'error',content:'登录账号或主联系手机已存在!',timeout:1000});
            }else{
                Plugins.closeWindow();
                Plugins.Tips({title:'信息提示',icon:'error',content:'操作失败!',timeout:1000});
            }
        });
    }
    function initTime(objId,val){
        //val = parseInt(val,10);
        for(var i=0;i<24;i++){
            $('<option value="'+i+'" '+((val==i)?"selected":'')+'>'+i+':00</option>').appendTo($('#'+objId));
            $('<option value="'+(i+".5")+'" '+((val==(i+".5"))?"selected":'')+'>'+i+':30</option>').appendTo($('#'+objId));
        }
    }
    function isInvoce(v){
        if(v){
            $('#invoiceRemarkstr').show();
        }else{
            $('#invoiceRemarkstr').hide();
        }
    }
     //获取分类
    function getCatList(objId,parentId,t,id){
    var objId = arguments[0]?arguments[0]:"goodsCatId2";
       var params = {};
       params.id = parentId;
       $('#'+objId).empty();
       if(t<1){
           $('#goodsCatId3').empty();
           $('#goodsCatId3').html('<option value="0">请选择</option>');
           if(parentId==0){
               $('#goodsCatId2').html('<option value="0">请选择</option>');
               return;
           }
       }
       var html = [];
       $.post("{:U('Home/GoodsCats/queryByList')}",params,function(data,textStatus){
            html.push('<option value="0">请选择</option>');
            var json = WST.toJson(data);
            if(json.status=='1' && json.list){
                var opts = null;
                for(var i=0;i<json.list.length;i++){
                    opts = json.list[i];
                    html.push('<option value="'+opts.catId+'" '+((id==opts.catId)?'selected':'')+'>'+opts.catName+'</option>');
                }
            }
            $('#'+objId).html(html.join(''));
       });
    }
</script>
<body class="wst-page" >
<iframe name="upload" style="display:none"></iframe>
<form id="uploadform_Filedata" autocomplete="off" style="<if condition='$object[shopId] gt 0'>top:234px;<else/>top:270px;</if>position:absolute;left:170px;z-index:10;" enctype="multipart/form-data" method="POST" target="upload" action="{:U('Home/Shops/uploadPic')}" >
    <div style="position:relative;">
        <input id="shopImg" name="shopImg" class="form-control wst-ipt" type="text" value="{$object.shopImg}" readonly style="margin-right:4px;float:left;margin-left:8px;width:250px;"/>
        <div class="div1">
            <div class="div2">浏览</div>
            <input type="file" class="inputstyle" id="Filedata" name="Filedata" onchange="updfile('Filedata');" >
        </div>
        <div style="clear:both;"></div>
        <div >&nbsp;图片大小:150 x 150 (px)(格式为 gif, jpg, jpeg, png)</div>
        <input type="hidden" name="dir" value="shops">
        <input type="hidden" name="width" value="150">
        <input type="hidden" name="folder" value="Filedata">
        <input type="hidden" name="sfilename" value="Filedata">
        <input type="hidden" name="fname" value="shopImg">
        <input type="hidden" class="s_Filedata" name="s_Filedata" value="">
    </div>
</form>

<form id="uploadform_Perm" autocomplete="off" style="<if condition='$object[shopId] gt 0'>top:470px;<else/>top:505px;</if>position:absolute;left:170px;z-index:10;" enctype="multipart/form-data" method="POST" target="upload" action="{:U('Home/Shops/uploadPic')}" >
    <div style="position:relative;">
        <input id="permitImg"  name="permitImg" class="form-control wst-ipt" type="text" value="{$object.permitImg}" readonly style="margin-right:4px;float:left;margin-left:8px;width:250px;"/>
        <div class="div1">
            <div class="div2">浏览</div>
            <input type="file" class="inputstyle" id="Perm" name="Perm" onchange="updfile('Perm');" >
        </div>
        <div style="clear:both;"></div>
        <div >&nbsp;图片大小:150 x 150 (px)(格式为 gif, jpg, jpeg, png)</div>
        <input type="hidden" name="dir" value="shops">
        <input type="hidden" name="width" value="150">
        <input type="hidden" name="folder" value="Perm">
        <input type="hidden" name="sfilename" value="Perm">
        <input type="hidden" name="fname" value="permitImg">
        <input type="hidden" class="s_Filedata" name="s_Filedata" value="">
    </div>
</form>

<form id="uploadform_Identi" autocomplete="off" style="<if condition='$object[shopId] gt 0'>top:700px;<else/>top:730px;</if>position:absolute;left:170px;z-index:10;" enctype="multipart/form-data" method="POST" target="upload" action="{:U('Home/Shops/uploadPic')}" >
    <div style="position:relative;">
        <input id="identityImg"  name="identityImg" class="form-control wst-ipt" type="text" value="{$object.idImg}" readonly style="margin-right:4px;float:left;margin-left:8px;width:250px;"/>
        <div class="div1">
            <div class="div2">浏览</div>
            <input type="file" class="inputstyle" id="Identi" name="Identi" onchange="updfile('Identi');" >
        </div>
        <div style="clear:both;"></div>
        <div >&nbsp;图片大小:150 x 150 (px)(格式为 gif, jpg, jpeg, png)</div>
        <input type="hidden" name="dir" value="shops">
        <input type="hidden" name="width" value="150">
        <input type="hidden" name="folder" value="Identi">
        <input type="hidden" name="sfilename" value="Identi">
        <input type="hidden" name="fname" value="identityImg">
        <input type="hidden" class="s_Filedata" name="s_Filedata" value="">

    </div>
</form>

<form id="uploadform_Identity" autocomplete="off" style="<if condition='$object[shopId] gt 0'>top:930px;<else/>top:960px;</if>position:absolute;left:170px;z-index:10;" enctype="multipart/form-data" method="POST" target="upload" action="{:U('Home/Shops/uploadPic')}" >
    <div style="position:relative;">
        <input id="identityRevImg"  name="identityRevImg" class="form-control wst-ipt" type="text" value="{$object.idRevImg}" readonly style="margin-right:4px;float:left;margin-left:8px;width:250px;"/>
        <div class="div1">
            <div class="div2">浏览</div>
            <input type="file" class="inputstyle" id="Identity" name="Identity" onchange="updfile('Identity');" >
        </div>
        <div style="clear:both;"></div>
        <div >&nbsp;图片大小:150 x 150 (px)(格式为 gif, jpg, jpeg, png)</div>
        <input type="hidden" name="dir" value="shops">
        <input type="hidden" name="width" value="150">
        <input type="hidden" name="folder" value="Identity">
        <input type="hidden" name="sfilename" value="Identity">
        <input type="hidden" name="fname" value="identityRevImg">
        <input type="hidden" class="s_Filedata" name="s_Filedata" value="">

    </div>
</form>

<form name="myform" method="post" id="myform" autocomplete="off">
    <input type='hidden' id='id' value='{$object.shopId}'/>

    <table class="table table-hover table-striped table-bordered wst-form">
		<if condition="$object['shopId'] ==0 ">
        <tr>
          <th width='150' align='right'>登录账号<font color='red'>*</font>：</th>
          <td><input type='text' id='loginName' name='loginName' class="form-control wst-ipt" value='{$object.loginName}' maxLength='25'/></td>
        </tr>
        </if>
        <tr>
            <th align='right'>店铺编号<font color='red'>*</font>：</th>
            <td><input type='text' id='shopSn' class="form-control wst-ipt" value='{$object.shopSn}' maxLength='25'/></td>

        <tr>
            <th align='right'>店铺名称<font color='red'>*</font>：</th>
            <td><input type='text' id='shopName' class="form-control wst-ipt" value='{$object.shopName}' maxLength='25' /></td>
        </tr>
        <tr>
            <th align='right'>店主姓名<font color='red'>*</font>：</th>
            <td><input type='text' id='userName' class="form-control wst-ipt" value='{$object.userName}' maxLength='25' /></td>
        </tr>

        <tr>
            <th align='right'>登录密码：</th>
            <td><input type='password' id='loginPwd' class="form-control wst-ipt" value='' maxLength='25'/></td>
        </tr>

        <tr>
            <th align='right'>店主手机<font color='red'>*</font>：</th>
            <td><input type='text' id='userPhone' name='userPhone' class="form-control wst-ipt" value='{$object.userPhone}' maxLength='25' />(app登录帐号)</td>
        </tr>
        <!--
        <tr>
            <th align='right'>客服系统<font color='red'>*</font>：</th>
            <td>
                <input type="text" id="Service" name="Service" value="{$object.Service}"/>
                <button id="openService">开启客服功能</button>
                <span id="ServiceMessage"></span>
            </td>
        </tr>
        -->
        <tr>
            <th align='right'>公司名称<font color='red'>*</font>：</th>
            <td><input type='text' id='shopCompany' class="form-control wst-ipt" value='{$object.shopCompany}' maxLength='25' /></td>
        </tr>
      <!--  <tr>
         <th align='right'>是否自营店<font color='red'>*</font>：</th>
         <td>
         <label>
         <input type='radio' id='isSelf1' name='isSelf' value='1' />是&nbsp;&nbsp;
         </label>
         <label>
         <input type='radio' id='isSelf0' name='isSelf' value='0' checked</if> />否
         </label>
         </td>
       </tr> -->
        <tr style="height:230px;">
            <th align='right'>店铺图标：</th>
            <td>
                <div id="preview_Filedata" style="margin-top: 70px;">
                    <img id='preview' src='__ROOT__/{$object.shopImg}' ref='__ROOT__/{$object.shopImg}'  height='152' <if condition="$object['shopImg'] =='' ">style='display:none'</if>/>
                </div>
            </td>
        </tr>
        <tr style="height:230px;">
            <th align='right'>营业执照图片：</th>
            <td>
                <div id="preview_Perm" style="margin-top: 70px;">
                    <img id='permit' src='__ROOT__/{$object.permitImg}' ref='__ROOT__/{$object.permitImg}' height="152" <if condition="$object['permitImg'] =='' ">style='display:none'</if>/>
                </div>
            </td>
        </tr>

        <tr style="height:230px;">
            <th align='right'>身份证正面照片<font color='red'>*</font>：</th>
            <td>
                <div id="preview_Identi" style="margin-top: 70px;">
                    <img id='identit' src='__ROOT__/{$object.idImg}'  ref='__ROOT__/{$object.idImg}' height="152" <if condition="$object['idImg'] =='' ">style='display:none'</if>/>
                </div>
            </td>
        </tr>

        <tr style="height:230px;">
            <th align='right'>身份证反面照片<font color='red'>*</font>：</th>
            <td>
                <div id="preview_Identity" style="margin-top: 70px;">
                    <img id='identityRev' src='__ROOT__/{$object.idRevImg}' ref='__ROOT__/{$object.idRevImg}' height="152" <if condition="$object['idRevImg'] =='' ">style='display:none'</if>/>
                </div>
            </td>
        </tr>
        <tr>
            <th align='right'>营业执照编号：</th>
            <td><input type='text' id='permitNo'  name="permitNo" class="form-control wst-ipt" value='{$object.permitNo}'  maxLength='25'/></td>
        </tr>
        <tr>
            <th align='right'>身份证号码<font color='red'>*</font>：</th>
            <td><input type='text' id='idNo' name="idNo" class="form-control wst-ipt" value='{$object.idNo}'  maxLength='25'/></td>
        </tr>
        <tr>
            <th align='right'>店铺电话<font color='red'>*</font>：</th>
            <td><input type='text' id='shopTel'  class="form-control wst-ipt" value='{$object.shopTel}' maxLength='25'/></td>
        </tr>
        <tr>
            <th align='right'>店铺QQ：</th>
            <td><input type='text' id='qqNo'  class="form-control wst-ipt" value='{$object.qqNo}' maxLength='25'/></td>
        </tr>
       <!--  <tr>
            <th align='right'>电子邮箱：</th>
            <td><input type='text' id='userEmail'  class="form-control wst-ipt" value='{//$object.userEmail}' maxLength='25'/></td>
        </tr> -->
        <tr>
            <th align='right'>所属地区<font color='red'>*</font>：</th>
                       <td>
             <select id='areaId1'  onchange='javascript:getAreaList("areaId2",this.value,0)'>
               <option value=''>请选择</option>
               <volist name="areaList" id="vo">
               <option value='{$vo['areaId']}' <if condition="$object['areaId1'] == $vo['areaId'] ">selected</if>>{$vo['areaName']}</option>
               </volist>
             </select>
             <select id='areaId2'  onchange='javascript:getAreaList("areaId3",this.value,1);getCommunitys()'>
               <option value=''>请选择</option>
             </select>
             <select id='areaId3' >
               <option value=''>请选择</option>
             </select>
             </td>
        </tr>
        <tr>
            <th align='right'>店铺地址<font color='red'>*</font>：</th>
            <td><input type='text' id='shopAddress' class="form-control wst-ipt" value='{$object.shopAddress}' maxLength='120' /></td>
        </tr>
        <tr id='shopMap' style='display:none'>
            <td>&nbsp;</td>
            <td>
                <div id="mapContainer" style='height:400px;width:90%;'>等待地图初始化...</div>
                <div style='display:none'>
                    <input type='text' id='latitude' name='latitude' value="{$object['latitude']}"/>
                    <input type='text' id='longitude' name='longitude' value="{$object['longitude']}"/>
                    <input type='text' id='mapLevel' name='mapLevel' value="{$object['mapLevel']}"/>
                </div>
            </td>
        </tr>
        <tr>
            <th align='right'>店铺分类<font color='red'>*</font>：</th>
            <td>
                <select id='goodsCatId1' onchange='javascript:getCatList("goodsCatId2",this.value,0)'>
                    <option value='0'>请选择</option>
                    <volist name="goodsCatsList" id="vo">
                    <option value='{$vo['catId']}' <if condition="$object['goodsCatId1'] == $vo['catId'] ">selected</if>>{$vo['catName']}</option>
                    </volist>
                 </select>
                 <select id='goodsCatId2' name='goodsCatId2'>
                    <option value='0'>请选择</option>
                 </select>
            </td>
        </tr>
        <tr>
            <th align='right'>营业状态<font color='red'>*</font>：</th>
            <td>
                <label>
                    <input   type='radio' id='shopAtive1' name='shopAtive' value='1' <if condition="$object['shopAtive'] ==1 ">checked</if> />营业中&nbsp;&nbsp;
                </label>
                <label>
                    <input    type='radio' id='shopAtive0' name='shopAtive' value='0' <if condition="$object['shopAtive'] ==0 ">checked</if> />休息中
                </label>
            </td>
        </tr>
        <!--
		 <tr>
             <th align='right'>商品是否需要审核<font color='red'>*</font>：</th>
             <td>
             <label>
             <input type='radio' id='goodsAudit' name='goodsAudit' value='1' <if condition="$object['goodsAudit'] ==1 ">checked</if> />不需要审核&nbsp;&nbsp;
             </label>
             <label>
             <input type='radio' id='goodsAudit' name='goodsAudit' value='0' <if condition="$object['goodsAudit'] ==0 ">checked</if> />需要审核
             </label>
             </td>
           </tr>
        
        <tr>
          <th align='right'>配送区域：</th>
          <td>
          <div id="allCommunity">
              <div class="text-gray Hide" >展开全部社区：<input type="checkbox" id="expendAll"></div>
              <div id='areaTree'></div>
          </div>
          </td>
        </tr> -->
        <tr>
            <th width='170' align='right'>订单配送起步价(元)<font color='red'>*</font>：</th>
            <td><input type='text' id='deliveryStartMoney' class="form-control wst-ipt" value='{$object.deliveryStartMoney}' onkeypress="return WST.isNumberdoteKey(event)" onkeyup="javascript:WST.isChinese(this,1)" maxLength='25' /></td>
        </tr>
        <!--
        <tr>
            <th align='right'>包邮起步价(元)<font color='red'>*</font>：</th>
            <td><input type='text' id='deliveryFreeMoney' class="form-control wst-ipt" value='{$object.deliveryFreeMoney}' onkeypress="return WST.isNumberdoteKey(event)" onkeyup="javascript:WST.isChinese(this,1)" maxLength='25' /></td>
        </tr>
        <tr>
            <th align='right'>邮费(元)<font color='red'>*</font>：</th>
            <td><input type='text' id='deliveryMoney' class="form-control wst-ipt" value='{$object.deliveryMoney}' onkeypress="return WST.isNumberdoteKey(event)" onkeyup="javascript:WST.isChinese(this,1)" maxLength='25' /></td>
        </tr>
        <tr>
            <th align='right'>平均配送时间(分钟)<font color='red'>*</font>：</th>
            <td><input type='text' id='deliveryCostTime' class="form-control wst-ipt" value='{$object.deliveryCostTime}' onkeypress="return WST.isNumberKey(event)" onkeyup="javascript:WST.isChinese(this,1)" maxLength='25' /></td>
        </tr>
        <tr>
            <th align='right'>平均消费金额<font color='red'>*</font>：</th>
            <td><input type='text' id='avgeCostMoney' class="form-control wst-ipt" value='{$object.avgeCostMoney}' onkeypress="return WST.isNumberdoteKey(event)" onkeyup="javascript:WST.isChinese(this,1)" maxLength='25' /></td>
        </tr>
        
		<tr>
             <th align='right'>配送方式<font color='red'>*</font>：</th>
             <td>
             	<label><input class="psMode" name="psMode[]" type="checkbox" value="1"  <if condition="strstr($object['psMode'],'1')">checked="checked" </if>/>到店自取</label>
				<label><input class="psMode"  name="psMode[]" type="checkbox" value="2" <if condition="strstr($object['psMode'],'2')">checked="checked" </if> />商家配送</label>
             </td>
        </tr>
        -->
        <tr>
            <th align='right'>所属银行：</th>
            <td>
                <select id='bankId' >
                    <option value=''>请选择</option>
                    <volist name="bankList" id="vo">
                        <option value='{$vo['bankId']}' <if condition="$object['bankId'] == $vo['bankId'] ">selected</if>>{$vo['bankName']}</option>
                    </volist>
                </select>
            </td>
        </tr>
        <tr>
            <th align='right'>银行卡卡号：</th>
            <td><input type='text' id='bankNo' class="form-control wst-ipt" value='{$object.bankNo}' maxLength='25' /></td>
        </tr>
 <!--       <tr>
            <th align='right'>能否开发票<font color='red'>*</font>：</th>
            <td>
                <label>
                    <input type='radio' id='isInvoice1' name='isInvoice' value='1' onclick='javascript:isInvoce(true)' />能&nbsp;&nbsp;
                </label>
                <label>
                    <input type='radio' id='isInvoice0' name='isInvoice' value='0' onclick='javascript:isInvoce(false)' />否
                </label>
            </td>
        </tr> -->
        <!-- <tr id='invoiceRemarkstr' <if condition="$object['isInvoice'] eq 0 ">style='display:none'</if>>
        <th align='right'>发票说明<font color='red'>*</font>：</th>
        <td><input type='text' id='invoiceRemarks' class="form-control wst-ipt" value='{$object.invoiceRemarks}' maxLength='25'/></td>
        </tr> -->
        <tr>
            <th align='right'>营业时间<font color='red'>*</font>：</th>
            <td>
                <select id='serviceStartTime' >
                    <option>请选择</option>
                </select>
                至
                <select id='serviceEndTime'>
                    <option>请选择</option>
                </select>
            </td>
        </tr>
        <tr>
            <th align='right'>店铺状态<font color='red'>*</font>：</th>
            <td>
                <label>
                    <input type='radio' id='shopStatus1' name='shopStatus' value='-2' <if condition="$object['shopStatus'] ==-2 ">checked</if> />已停止&nbsp;&nbsp;
                </label>
                <label>
                    <input type='radio' id='shopStatus0' name='shopStatus' value='-1' <if condition="$object['shopStatus'] ==-1 ">checked</if> />拒绝
                </label>
                <label>
                    <input type='radio' id='shopStatus2' name='shopStatus' value='0' <if condition="$object['shopStatus'] ==0 ">checked</if> />待审核
                </label>
                <label>
                    <input type='radio' id='shopStatus3' name='shopStatus' value='1' <if condition="$object['shopStatus'] ==1 ">checked</if> />已审核
                </label>
            </td>
        </tr>
        <tr id="refuseMsg" <if condition="$object['shopStatus'] gt -1 ">style='display:none'</if>>
        <th>拒绝理由：</th>
        <td>
            <input class="form-control wst-ipt" type="text" id="statusRemarks" name="statusRemarks" length="255" value="{$object['statusRemarks']}">
        </td>
        </tr>
        <tr>
            <th align='right'>佣金比例<font color='red'>*</font>：</th>
            <td><input type='text' id='proportion' class="form-control wst-ipt" value='{$object.proportion}' onkeypress="return WST.isNumberdoteKey(event)" onkeyup="javascript:WST.isChinese(this,1)" maxLength='25'/></td>
        </tr>
        <tr>
            <td colspan='2' style='padding-left:250px;'>
                <button type="submit" class="btn btn-success">保&nbsp;存</button>
                <button type="button" class="btn btn-primary" onclick='javascript:location.href="{:U('Admin/Shops/index')}"'>返&nbsp;回</button>
            </td>
        </tr>
    </table>
</form>
</body>
</html>